package compare;

import java.util.concurrent.CyclicBarrier;

class SyncTest extends TestTemplate{
    public SyncTest(String id, int round, int threadNum, CyclicBarrier cb){
        super( id, round, threadNum, cb);
    }
//  @Override
    /**
     * synchronized关键字不在方法签名里面，所以不涉及重载问题
     */
    synchronized long  getValue() {
        return super.countValue;
    }
//  @Override
    synchronized void  sumValue() {
        super.countValue+=preInit[index++%round];
    }
}
 